<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">

<html><head><title>C:\Documents and Settings\Chris\My Documents\Programming\C++\Borealis\src\include\borealis\AsciiRaster.h</title><link rel="stylesheet" type="text/css" href="../../../styles/main.css"><script language=JavaScript src="../../../javascript/main.js"></script><script language=JavaScript src="../../../javascript/searchdata.js"></script></head><body class="ContentPage" onLoad="NDOnLoad()"><script language=JavaScript><!--
if (browserType) {document.write("<div class=" + browserType + ">");if (browserVer) {document.write("<div class=" + browserVer + ">"); }}// --></script>

<!--  Generated by Natural Docs, version 1.4 -->
<!--  http://www.naturaldocs.org  -->

<!-- saved from url=(0026)http://www.naturaldocs.org -->




<div id=Content><div class="CFile"><div class=CTopic id=MainTopic><h1 class=CTitle><a name="AsciiRaster.h"></a>AsciiRaster.h</h1><div class=CBody><!--START_ND_SUMMARY--><div class=Summary><div class=STitle>Summary</div><div class=SBorder><table border=0 cellspacing=0 cellpadding=0 class=STable><tr class="SMain"><td class=SEntry><a href="#AsciiRaster.h" >AsciiRaster.h</a></td><td class=SDescription></td></tr><tr class="SGroup"><td class=SEntry><a href="#Functions" >Functions</a></td><td class=SDescription></td></tr><tr class="SFunction SIndent1 SMarked"><td class=SEntry><a href="#OpenFromFile" id=link1 onMouseOver="ShowTip(event, 'tt1', 'link1')" onMouseOut="HideTip('tt1')">OpenFromFile</a></td><td class=SDescription>Opens an 2 dimension x,y ascii raster ASCII overwriting any current data. </td></tr><tr class="SFunction SIndent1"><td class=SEntry><a href="#AsciiRaster" id=link2 onMouseOver="ShowTip(event, 'tt2', 'link2')" onMouseOut="HideTip('tt2')">AsciiRaster</a></td><td class=SDescription>Copy Constructor</td></tr><tr class="SFunction SIndent1 SMarked"><td class=SEntry><a href="#AsciiRaster" id=link3 onMouseOver="ShowTip(event, 'tt2', 'link3')" onMouseOut="HideTip('tt2')">AsciiRaster</a></td><td class=SDescription></td></tr><tr class="SFunction SIndent1"><td class=SEntry><a href="#AsciiRaster" id=link4 onMouseOver="ShowTip(event, 'tt2', 'link4')" onMouseOut="HideTip('tt2')">AsciiRaster</a></td><td class=SDescription>Creates a new raster row x col</td></tr><tr class="SFunction SIndent1 SMarked"><td class=SEntry><a href="#SaveToFile" id=link5 onMouseOver="ShowTip(event, 'tt3', 'link5')" onMouseOut="HideTip('tt3')">SaveToFile</a></td><td class=SDescription>Saves the current raster in memory to a file</td></tr><tr class="SFunction SIndent1"><td class=SEntry><a href="#SaveToXYZ" id=link6 onMouseOver="ShowTip(event, 'tt4', 'link6')" onMouseOut="HideTip('tt4')">SaveToXYZ</a></td><td class=SDescription></td></tr><tr class="SFunction SIndent1 SMarked"><td class=SEntry><a href="#ScaleBy" id=link7 onMouseOver="ShowTip(event, 'tt5', 'link7')" onMouseOut="HideTip('tt5')">ScaleBy</a></td><td class=SDescription>Scales the current raster by a factor.</td></tr><tr class="SFunction SIndent1"><td class=SEntry><a href="#GetXllCorner" id=link8 onMouseOver="ShowTip(event, 'tt6', 'link8')" onMouseOut="HideTip('tt6')">GetXllCorner</a></td><td class=SDescription>Returns x-lower-left corner extent</td></tr><tr class="SFunction SIndent1 SMarked"><td class=SEntry><a href="#GetYllCorner" id=link9 onMouseOver="ShowTip(event, 'tt7', 'link9')" onMouseOut="HideTip('tt7')">GetYllCorner</a></td><td class=SDescription>Returns y-lower-left corner extent</td></tr><tr class="SFunction SIndent1"><td class=SEntry><a href="#GetCellSize" id=link10 onMouseOver="ShowTip(event, 'tt8', 'link10')" onMouseOut="HideTip('tt8')">GetCellSize</a></td><td class=SDescription>Returns the cell size</td></tr><tr class="SFunction SIndent1 SMarked"><td class=SEntry><a href="#GetNoData" id=link11 onMouseOver="ShowTip(event, 'tt9', 'link11')" onMouseOut="HideTip('tt9')">GetNoData</a></td><td class=SDescription>Returns the value used to represent &lsquo;no data&rsquo;</td></tr></table></div></div><!--END_ND_SUMMARY--></div></div></div>

<div class="CGroup"><div class=CTopic><h3 class=CTitle><a name="Functions"></a>Functions</h3></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="OpenFromFile"></a>OpenFromFile</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>void OpenFromFile(</td><td class=PTypePrefix nowrap>std::</td><td class=PType nowrap>string&nbsp;</td><td class=PParameter nowrap>path</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Opens an 2 dimension x,y ascii raster ASCII overwriting any current data.&nbsp; Data can be either integer (+/-) or single precision floating point (+/-).&nbsp; The file must have the following header with no leading blanks lines:</p><blockquote><pre>ncols         &lt;int&gt;
nrows         &lt;int&gt;
xllcorner     &lt;int&gt;
yllcorner     &lt;int&gt;
cellsize      &lt;int&gt;
NODATA_value  &lt;float/int&gt;</pre></blockquote><p>Values are tab/space delimited.</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>std::string path</td><td class=CDLDescription>Path to the file to open</td></tr></table><h4 class=CHeading>Throws</h4><p>std::runtime_error if the file is not a valid ascii raster std::bad_alloc if not enough memory can be allocated to hold the array</p><h4 class=CHeading>Returns</h4><p>void</p></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="AsciiRaster"></a>AsciiRaster</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>AsciiRaster(</td><td class=PType nowrap>AsciiRaster&nbsp;</td><td class=PParameterPrefix nowrap>&amp;</td><td class=PParameter nowrap>in</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Copy Constructor</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>AsciiRaster &amp; in</td><td class=CDLDescription>Raster to copy from</td></tr></table><h4 class=CHeading>Throws</h4><p>Never</p><h4 class=CHeading>Returns</h4></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="AsciiRaster"></a>AsciiRaster</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td>AsciiRaster()</td></tr></table></blockquote><h4 class=CHeading>Parameters</h4><h4 class=CHeading>Throws</h4><h4 class=CHeading>Returns</h4><p>-</p></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="AsciiRaster"></a>AsciiRaster</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>AsciiRaster(</td><td class=PTypePrefix nowrap>unsigned&nbsp;</td><td class=PType nowrap>int&nbsp;</td><td class=PParameter nowrap>row,</td></tr><tr><td></td><td class=PTypePrefix nowrap>unsigned&nbsp;</td><td class=PType nowrap>int&nbsp;</td><td class=PParameter nowrap>col</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Creates a new raster row x col</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>unsigned int row</td><td class=CDLDescription>Rows</td></tr><tr><td class=CDLEntry>unsigned int col</td><td class=CDLDescription>Columns</td></tr></table><h4 class=CHeading>Throws</h4><p>std::bad_alloc if the memory can&rsquo;t be allocated</p><h4 class=CHeading>Returns</h4></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="SaveToFile"></a>SaveToFile</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>void SaveToFile(</td><td class=PTypePrefix nowrap>std::</td><td class=PType nowrap>string&nbsp;</td><td class=PParameter nowrap>outFile</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Saves the current raster in memory to a file</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>std::string outFile</td><td class=CDLDescription>Path to the file</td></tr></table><h4 class=CHeading>Throws</h4><p>std::runtime_error if the internal raster does not exist (ie, you haven&rsquo;t created one).</p><h4 class=CHeading>Returns</h4></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="SaveToXYZ"></a>SaveToXYZ</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>void SaveToXYZ(</td><td class=PTypePrefix nowrap>std::</td><td class=PType nowrap>string&nbsp;</td><td class=PParameter nowrap>outFile</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><h4 class=CHeading>Saves the current in memory raster to a file in X-Y-Z format.&nbsp; That is</h4><blockquote><pre>x y z
0 0 43.5
0 1 41.95
[...]</pre></blockquote><p>This does not modify the in memory raster.</p><p>Currently, this does not use the xll and yll extends to calculate the correct x/y.&nbsp; Rather, it uses the position in the raster, for example, (0,4), and uses that as x/y.</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>std::string outFile</td><td class=CDLDescription>File to save to</td></tr></table><h4 class=CHeading>Throws</h4><p>std::runtime_error on inability to open output file</p><h4 class=CHeading>Returns</h4></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="ScaleBy"></a>ScaleBy</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>void ScaleBy(</td><td class=PType nowrap>float&nbsp;</td><td class=PParameter nowrap>scaleFactor</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Scales the current raster by a factor.</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>double scaleFactor</td><td class=CDLDescription>Factor to scale the raster by</td></tr></table><h4 class=CHeading>Throws</h4><p>std::runtime_error if there is no raster in memory</p><h4 class=CHeading>Returns</h4><p>void</p></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="GetXllCorner"></a>GetXllCorner</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td>unsigned int GetXllCorner()</td></tr></table></blockquote><p>Returns x-lower-left corner extent</p><h4 class=CHeading>Parameters</h4><p>None</p><h4 class=CHeading>Throws</h4><p>Never</p><h4 class=CHeading>Returns</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>unsigned int</td><td class=CDLDescription>xllcorner as defined in the raster file</td></tr></table></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="GetYllCorner"></a>GetYllCorner</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td>unsigned int GetYllCorner()</td></tr></table></blockquote><p>Returns y-lower-left corner extent</p><h4 class=CHeading>Parameters</h4><p>None</p><h4 class=CHeading>Throws</h4><p>Never</p><h4 class=CHeading>Returns</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>unsigned int</td><td class=CDLDescription>yllcorner as defined in the raster file</td></tr></table></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="GetCellSize"></a>GetCellSize</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td>unsigned int GetCellSize()</td></tr></table></blockquote><p>Returns the cell size</p><h4 class=CHeading>Parameters</h4><p>None</p><h4 class=CHeading>Throws</h4><p>Never</p><h4 class=CHeading>Returns</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>unsigned int</td><td class=CDLDescription>cellsize as defined in the raster file</td></tr></table></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="GetNoData"></a>GetNoData</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td>float GetNoData()</td></tr></table></blockquote><p>Returns the value used to represent &lsquo;no data&rsquo;</p><h4 class=CHeading>Parameters</h4><p>None</p><h4 class=CHeading>Throws</h4><p>Never</p><h4 class=CHeading>Returns</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>unsigned int</td><td class=CDLDescription>NODATA_value as defined in the raster file</td></tr></table></div></div></div>

</div><!--Content-->


<div id=Footer><a href="http://www.naturaldocs.org">Generated by Natural Docs</a></div><!--Footer-->


<div id=Menu><div class=MEntry><div class=MFile id=MSelected>AsciiRaster.h</div></div><div class=MEntry><div class=MFile><a href="Clock-h.html">Clock.h</a></div></div><div class=MEntry><div class=MFile><a href="Logger-h.html">Logger.h</a></div></div><div class=MEntry><div class=MFile><a href="Observation-h.html">Observation</a></div></div><div class=MEntry><div class=MFile><a href="Raster-h.html">Raster.h</a></div></div><div class=MEntry><div class=MFile><a href="RegexTokenizer-h.html">RegexTokenizer</a></div></div><div class=MEntry><div class=MGroup><a href="javascript:ToggleMenu('MGroupContent1')">Index</a><div class=MGroupContent id=MGroupContent1><div class=MEntry><div class=MIndex><a href="../../../index/General.html">Everything</a></div></div><div class=MEntry><div class=MIndex><a href="../../../index/Classes.html">Classes</a></div></div><div class=MEntry><div class=MIndex><a href="../../../index/Functions.html">Functions</a></div></div><div class=MEntry><div class=MIndex><a href="../../../index/Files.html">Files</a></div></div><div class=MEntry><div class=MIndex><a href="../../../index/Constants.html">Constants</a></div></div><div class=MEntry><div class=MIndex><a href="../../../index/Types.html">Types</a></div></div></div></div></div><script type="text/javascript"><!--
var searchPanel = new SearchPanel("searchPanel", "HTML", "../../../search");
--></script><div id=MSearchPanel class=MSearchPanelInactive><input type=text id=MSearchField value=Search onFocus="searchPanel.OnSearchFieldFocus(true)" onBlur="searchPanel.OnSearchFieldFocus(false)" onKeyUp="searchPanel.OnSearchFieldChange()"><select id=MSearchType onFocus="searchPanel.OnSearchTypeFocus(true)" onBlur="searchPanel.OnSearchTypeFocus(false)" onChange="searchPanel.OnSearchTypeChange()"><option  id=MSearchEverything selected value="General">Everything</option><option value="Classes">Classes</option><option value="Constants">Constants</option><option value="Files">Files</option><option value="Functions">Functions</option><option value="Types">Types</option></select></div></div><!--Menu-->



<!--START_ND_TOOLTIPS-->
<div class=CToolTip id="tt1"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>void OpenFromFile(</td><td class=PTypePrefix nowrap>std::</td><td class=PType nowrap>string&nbsp;</td><td class=PParameter nowrap>path</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote>Opens an 2 dimension x,y ascii raster ASCII overwriting any current data. </div></div><div class=CToolTip id="tt2"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>AsciiRaster(</td><td class=PType nowrap>AsciiRaster&nbsp;</td><td class=PParameterPrefix nowrap>&amp;</td><td class=PParameter nowrap>in</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote>Copy Constructor</div></div><div class=CToolTip id="tt3"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>void SaveToFile(</td><td class=PTypePrefix nowrap>std::</td><td class=PType nowrap>string&nbsp;</td><td class=PParameter nowrap>outFile</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote>Saves the current raster in memory to a file</div></div><div class=CToolTip id="tt4"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>void SaveToXYZ(</td><td class=PTypePrefix nowrap>std::</td><td class=PType nowrap>string&nbsp;</td><td class=PParameter nowrap>outFile</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote></div></div><div class=CToolTip id="tt5"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>void ScaleBy(</td><td class=PType nowrap>float&nbsp;</td><td class=PParameter nowrap>scaleFactor</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote>Scales the current raster by a factor.</div></div><div class=CToolTip id="tt6"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td>unsigned int GetXllCorner()</td></tr></table></blockquote>Returns x-lower-left corner extent</div></div><div class=CToolTip id="tt7"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td>unsigned int GetYllCorner()</td></tr></table></blockquote>Returns y-lower-left corner extent</div></div><div class=CToolTip id="tt8"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td>unsigned int GetCellSize()</td></tr></table></blockquote>Returns the cell size</div></div><div class=CToolTip id="tt9"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td>float GetNoData()</td></tr></table></blockquote>Returns the value used to represent &lsquo;no data&rsquo;</div></div><!--END_ND_TOOLTIPS-->




<div id=MSearchResultsWindow><iframe src="" frameborder=0 name=MSearchResults id=MSearchResults></iframe><a href="javascript:searchPanel.CloseResultsWindow()" id=MSearchResultsWindowClose>Close</a></div>


<script language=JavaScript><!--
if (browserType) {if (browserVer) {document.write("</div>"); }document.write("</div>");}// --></script></body></html>